Delimited Control in OCaml, Abstractly and Concretely: System Description

نویسنده

  • Oleg Kiselyov
چکیده

We describe the first implementation of multi-prompt delimited control operators in OCaml that is direct in that it captures only the needed part of the control stack. The implementation is a library that requires no changes to the OCaml compiler or run-time, so it is perfectly compatible with existing OCaml source code and byte-code. The library has been in fruitful practical use for four years. We present the library as an implementation of an abstract machine derived by elaborating the definitional machine. The abstract view lets us distill a minimalistic API, scAPI, sufficient for implementing multiprompt delimited control. We argue that a language system that supports exception and stack-overflow handling supports scAPI. Our library illustrates how to use scAPI to implement multi-prompt delimited control in a typed language. The approach is general and can be used to add multi-prompt delimited control to other existing language systems.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Impact of construal level manipulations on delay discounting

Construal Level Theory states that psychologically proximal outcomes are construed concretely while psychologically distal outcomes are construed abstractly. Previous research suggests that the principles of Construal Level Theory can be applied to enhance self-control, as measured by delay discounting. The present studies replicate and expand on this work by examining whether theory-informed p...

متن کامل

A Substructural Type System for Delimited Continuations

We propose type systems that abstractly interpret small-step rather than big-step operational semantics. We treat an expression or evaluation context as a structure in a linear logic with hypothetical reasoning. Evaluation order is not only regulated by familiar focusing rules in the operational semantics, but also expressed by structural rules in the type system, so the types track control flo...

متن کامل

The influence of framing on clinicians' judgments of the biological basis of behaviors.

Practicing clinicians frequently think about behaviors both abstractly (i.e., in terms of symptoms, as in the Diagnostic and Statistical Manual of Mental Disorders, 5th ed., DSM-5; American Psychiatric Association, 2013) and concretely (i.e., in terms of individual clients, as in DSM-5 Clinical Cases; Barnhill, 2013). Does abstract/concrete framing influence clinical judgments about behaviors? ...

متن کامل

From Theory to Practice of Algebraic Effects and Handlers (Dagstuhl Seminar 16112)

Dagstuhl Seminar 16112 was devoted to research in algebraic effects and handlers, a chapter in the principles of programming languages which addresses computational effects (such as I/O, state, exceptions, nondeterminism, and many others). The speakers and the working groups covered a range of topics, including comparisons between various control mechanisms (handlers vs. delimited control), imp...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2010